package TestCTR;

import org.junit.Test;
import java.util.ArrayList;

import CTRLayer.*;
import ModelLayer.*;

public class TestChildCTR 
{
	private ChildCTR ct = new ChildCTR();
	private Child ch = new Child();

	
	@Test
	public void testFindAllChilds()
	{
		ArrayList<Child> ctlist = ct.findAllChilds();
		int id = 0;
		System.out.println("\nAntal børn : " + ctlist.size() + "\n");
		while (id < ctlist.size())
		{
			System.out.println("Child id           : " + ctlist.get(id).getChildID());
			System.out.println("Person id          : " + ctlist.get(id).getPersonID());
			System.out.println("Registreringd dato : " + ctlist.get(id).getRegistrationDate());
			System.out.println("CPR                : " + ctlist.get(id).getCPR());
			System.out.println("Navn               : " + ctlist.get(id).getfName() + " " + ctlist.get(id).getlName());
			System.out.println("Adresse            : " + ctlist.get(id).getAddress());
			System.out.println("Postnr og By       : " + ctlist.get(id).getPostalCode() + " " + ctlist.get(id).getCity());
			System.out.println("Mobil              : " + ctlist.get(id).getMobileNr());
			System.out.println("Telefon            : " + ctlist.get(id).getPhoneNr());
			System.out.println("--------------------------------------------------");
			id++;
		}
	}

	@Test
	public void testFindChildID() 
	{
		int id = 1;
		ch = ct.findChildID(id);
		System.out.println("Child id           : " + ch.getChildID());
		System.out.println("Person id          : " + ch.getPersonID());
		System.out.println("Registreringd dato : " + ch.getRegistrationDate());
		System.out.println("CPR                : " + ch.getCPR());
		System.out.println("Navn               : " + ch.getfName() + " " + ch.getlName());
		System.out.println("Adresse            : " + ch.getAddress());
		System.out.println("Postnr og By       : " + ch.getPostalCode() + " " + ch.getCity());
		System.out.println("Mobil              : " + ch.getMobileNr());
		System.out.println("Telefon            : " + ch.getPhoneNr());
		System.out.println("--------------------------------------------------");
	}
}
